package edu.avans.hartigehap.domain;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Transient;

@Entity
public class WebPizza extends WebPizzaBase implements Serializable{
	private static final long serialVersionUID = 1L;

	private WebMenuItem menuPizza;

	public WebPizza () {

	}

	public WebPizza (MenuPizza menuPizza) {
		this.menuPizza = menuPizza;
	}

	@Transient
	public BigDecimal getPrice() {
		return menuPizza.getPrice();
	}

	@Transient
	public void setPrice(BigDecimal price) {

	}

	@Transient
	public String getDishName() {
		return menuPizza.getDishName();
	}

	@Transient
	public void setDishName(String pizzaName) {

	}

	@Transient
	public BigDecimal getTotalPrice() {
		return getPrice();
	}

	@Transient
	public String getTotalName() {
		return getDishName();
	}

	@OneToOne()
	@JoinColumn(name="WEBMENUITEM_ID",referencedColumnName="WEBMENUITEM_ID", updatable=false)
	public WebMenuItem getMenuPizza() {
		return menuPizza;
	}

	public void setMenuPizza(WebMenuItem menuPizza) {
		this.menuPizza = menuPizza;
	}

}
